<template>
  <div class="cooperation">
    <h1 class="title">合作</h1>
    <editors :pid="3" class="editor-in-cooperation"></editors>
    <div class="btn-box">
      <el-button class="submit el-button--success" @click="submitfn">提交</el-button>
    </div>
    
  </div>
</template>

<script>
import editors from "../wangeditor";
export default {
  components: {
    editors,
  },
  methods: {
    submitfn() {
      let info = localStorage.getItem("info");
      let id = 3;
      let token = sessionStorage.getItem("token");
      let value = { token: token, id: id , info: info };
      this.$http.post("/api/admin/aboutModify", value).then((res) => {
        //请求成功
        console.log(res);
        if (res.data.code == 3000) {
          this.$message({ message: "身份失效请重新登录", type: "error" });
        } else if (res.data.code == 2000) {
          this.$message({ message: "操作成功", type: "success" });
        } else if (res.data.code == 2001) {
          this.$message({ message: "内容不能为空", type: "warning" });
        }
      });
    },
  },
};
</script>

<style scoped>
.title {
  padding: 0;
  margin: 0;
  margin-top: 20px;
  text-align: center;
}
.editor-in-cooperation{
  width: 96% !important;
  margin-left:2%;
  box-sizing: border-box;
}

.btn-box{
 text-align: center;
}


</style>